/*!
 * jQuery jquery.plupload.queue.min.js
 */
!function(u,_){var r={};function c(l){return _.translate(l)||l}u.fn.pluploadQueue=function(t){return t?(this.each(function(){var i,p,o,d,l,a;function s(l){l.status==_.DONE&&(a="plupload_done"),l.status==_.FAILED&&(a="plupload_failed"),l.status==_.QUEUED&&(a="plupload_delete"),l.status==_.UPLOADING&&(a="plupload_uploading");var a=u("#"+l.id).attr("class",a).find("a").css("display","block");l.hint&&a.attr("title",l.hint)}function n(){u("span.plupload_total_status",p).html(i.total.percent+"%"),u("div.plupload_progress_bar",p).css("width",i.total.percent+"%"),u("span.plupload_upload_status",p).html(_.sprintf(c("Uploaded %d/%d files"),i.total.uploaded,i.files.length))}function e(){var e,t=u("ul.plupload_filelist",p).html(""),d=0;u.each(i.files,function(l,a){e="",a.status==_.DONE&&(a.target_name&&(e+='<input type="hidden" name="'+o+"_"+d+'_tmpname" value="'+_.xmlEncode(a.target_name)+'" />'),e+='<input type="hidden" name="'+o+"_"+d+'_name" value="'+_.xmlEncode(a.name)+'" />',e+='<input type="hidden" name="'+o+"_"+d+'_status" value="'+(a.status==_.DONE?"done":"failed")+'" />',d++,u("#"+o+"_count").val(d)),t.append('<li id="'+a.id+'"><div class="plupload_file_name"><span>'+_.xmlEncode(a.name)+'</span></div><div class="plupload_file_action"><a href="#"></a></div><div class="plupload_file_status">'+a.percent+'%</div><div class="plupload_file_size">'+_.formatSize(a.size)+'</div><div class="plupload_clearer">&nbsp;</div>'+e+"</li>"),s(a),u("#"+a.id+".plupload_delete a").click(function(l){u("#"+a.id).remove(),i.removeFile(a),l.preventDefault()})}),u("span.plupload_total_file_size",p).html(_.formatSize(i.total.size)),0===i.total.queued?u("span.plupload_add_text",p).html(c("Add Files")):u("span.plupload_add_text",p).html(_.sprintf(c("%d files queued"),i.total.queued)),u("a.plupload_start",p).toggleClass("plupload_disabled",i.files.length==i.total.uploaded+i.total.failed),t[0].scrollTop=t[0].scrollHeight,n(),!i.files.length&&i.features.dragdrop&&i.settings.dragdrop&&u("#"+o+"_filelist").append('<li class="plupload_droptext">'+c("Drag files here.")+"</li>")}p=u(this),(o=p.attr("id"))||(o=_.guid(),p.attr("id",o)),d=p.html(),l=o,(a=p).contents().each(function(l,a){(a=u(a)).is(".plupload")||a.remove()}),a.prepend('<div class="plupload_wrapper plupload_scroll"><div id="'+l+'_container" class="plupload_container"><div class="plupload"><div class="plupload_header"><div class="plupload_header_content"><div class="plupload_header_title">'+c("Select files")+'</div><div class="plupload_header_text">'+c("Add files to the upload queue and click the start button.")+'</div></div></div><div class="plupload_content"><div class="plupload_filelist_header"><div class="plupload_file_name">'+c("Filename")+'</div><div class="plupload_file_action">&nbsp;</div><div class="plupload_file_status"><span>'+c("Status")+'</span></div><div class="plupload_file_size">'+c("Size")+'</div><div class="plupload_clearer">&nbsp;</div></div><ul id="'+l+'_filelist" class="plupload_filelist"></ul><div class="plupload_filelist_footer"><div class="plupload_file_name"><div class="plupload_buttons"><a href="#" class="plupload_button plupload_add" id="'+l+'_browse">'+c("Add Files")+'</a><a href="#" class="plupload_button plupload_start">'+c("Start Upload")+'</a></div><span class="plupload_upload_status"></span></div><div class="plupload_file_action"></div><div class="plupload_file_status"><span class="plupload_total_status">0%</span></div><div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div><div class="plupload_progress"><div class="plupload_progress_container"><div class="plupload_progress_bar"></div></div></div><div class="plupload_clearer">&nbsp;</div></div></div></div></div><input type="hidden" id="'+l+'_count" name="'+l+'_count" value="0" /></div>'),(t=u.extend({dragdrop:!0,browse_button:o+"_browse",container:o},t)).dragdrop&&(t.drop_element=o+"_filelist"),i=new _.Uploader(t),(r[o]=i).bind("UploadFile",function(l,a){u("#"+a.id).addClass("plupload_current_file")}),i.bind("Init",function(s,l){!t.unique_names&&t.rename&&p.on("click","#"+o+"_filelist div.plupload_file_name span",function(l){var e,a,t=u(l.target),d="";t.closest("li").hasClass("plupload_delete")&&(a=(e=s.getFile(t.parents("li")[0].id)).name,(l=/^(.+)(\.[^.]+)$/.exec(a))&&(a=l[1],d=l[2]),t.hide().after('<input type="text" />'),t.next().val(a).focus().blur(function(){t.show().next().remove()}).keydown(function(l){var a=u(this);13==l.keyCode&&(l.preventDefault(),e.name=a.val()+d,t.text(e.name),a.blur())}))}),u("#"+o+"_container").attr("title","Using runtime: "+l.runtime),u("a.plupload_start",p).click(function(l){u(this).hasClass("plupload_disabled")||i.start(),l.preventDefault()}),u("a.plupload_stop",p).click(function(l){l.preventDefault(),i.stop()}),u("a.plupload_start",p).addClass("plupload_disabled")}),i.bind("Error",function(l,a){var e,t=a.file;t&&(e=a.message,a.details&&(e+=" ("+a.details+")"),a.code==_.FILE_SIZE_ERROR&&alert(c("Error: File too large:")+" "+t.name),a.code==_.FILE_EXTENSION_ERROR&&alert(c("Error: Invalid file extension:")+" "+t.name),t.hint=e,u("#"+t.id).attr("class","plupload_failed").find("a").css("display","block").attr("title",e)),a.code===_.INIT_ERROR&&setTimeout(function(){delete r[o],i.destroy(),p.html(d),i=p=d=null},1)}),i.bind("PostInit",function(l){l.settings.dragdrop&&l.features.dragdrop&&u("#"+o+"_filelist").append('<li class="plupload_droptext">'+c("Drag files here.")+"</li>")}),i.init(),i.bind("StateChanged",function(){i.state===_.STARTED?(u("li.plupload_delete a,div.plupload_buttons",p).hide(),i.disableBrowse(!0),u("span.plupload_upload_status,div.plupload_progress,a.plupload_stop",p).css("display","block"),u("span.plupload_upload_status",p).html("Uploaded "+i.total.uploaded+"/"+i.files.length+" files"),t.multiple_queues&&u("span.plupload_total_status,span.plupload_total_file_size",p).show()):(e(),u("a.plupload_stop,div.plupload_progress",p).hide(),u("a.plupload_delete",p).css("display","block"),t.multiple_queues&&i.total.uploaded+i.total.failed==i.files.length&&(u(".plupload_buttons,.plupload_upload_status",p).css("display","inline"),i.disableBrowse(!1),u(".plupload_start",p).addClass("plupload_disabled"),u("span.plupload_total_status,span.plupload_total_file_size",p).hide()))}),i.bind("FilesAdded",e),i.bind("FilesRemoved",function(){var l=u("#"+o+"_filelist").scrollTop();e(),u("#"+o+"_filelist").scrollTop(l)}),i.bind("FileUploaded",function(l,a){s(a)}),i.bind("UploadProgress",function(l,a){u("#"+a.id+" div.plupload_file_status",p).html(a.percent+"%"),s(a),n()}),t.setup&&t.setup(i)}),this):r[u(this[0]).attr("id")]}}(jQuery,plupload);

/*!
 * jQuery ui.plupload.min.js
 */
!function(d,_,c){var i={};function o(t){return d.translate(t)||t}c.widget("ui.plupload",{widgetEventPrefix:"",contents_bak:"",options:{browse_button_hover:"ui-state-hover",browse_button_active:"ui-state-active",filters:{},buttons:{browse:!0,start:!0,stop:!0},views:{list:!0,thumbs:!1,active:"list",remember:!0},thumb_width:100,thumb_height:60,multiple_queues:!0,dragdrop:!0,autostart:!1,sortable:!1,rename:!1},FILE_COUNT_ERROR:-9001,_create:function(){var t,e=this.element.attr("id");e||(e=d.guid(),this.element.attr("id",e)),this.id=e,this.contents_bak=this.element.html(),(t=this.element).id=t.attr("id"),t.html('<div class="plupload_wrapper"><div class="ui-widget-content plupload_container"><div class="ui-state-default ui-widget-header plupload_header"><div class="plupload_header_content"><div class="plupload_logo"> </div><div class="plupload_header_title">'+o("Select files")+'</div><div class="plupload_header_text">'+o("Add files to the upload queue and click the start button.")+'</div><div class="plupload_view_switch"><input type="radio" id="'+t.id+'_view_list" name="view_mode_'+t.id+'" checked="checked" /><label class="plupload_button" for="'+t.id+'_view_list" data-view="list">'+o("List")+'</label><input type="radio" id="'+t.id+'_view_thumbs" name="view_mode_'+t.id+'" /><label class="plupload_button"  for="'+t.id+'_view_thumbs" data-view="thumbs">'+o("Thumbnails")+'</label></div></div></div><table class="plupload_filelist plupload_filelist_header ui-widget-header"><tr><td class="plupload_cell plupload_file_name">'+o("Filename")+'</td><td class="plupload_cell plupload_file_status">'+o("Status")+'</td><td class="plupload_cell plupload_file_size">'+o("Size")+'</td><td class="plupload_cell plupload_file_action">&nbsp;</td></tr></table><div class="plupload_content"><div class="plupload_droptext">'+o("Drag files here.")+'</div><ul class="plupload_filelist_content"> </ul><div class="plupload_clearer">&nbsp;</div></div><table class="plupload_filelist plupload_filelist_footer ui-widget-header"><tr><td class="plupload_cell plupload_file_name"><div class="plupload_buttons">\x3c!-- Visible --\x3e<a class="plupload_button plupload_add">'+o("Add Files")+'</a>&nbsp;<a class="plupload_button plupload_start">'+o("Start Upload")+'</a>&nbsp;<a class="plupload_button plupload_stop plupload_hidden">'+o("Stop Upload")+'</a>&nbsp;</div><div class="plupload_started plupload_hidden">\x3c!-- Hidden --\x3e<div class="plupload_progress plupload_right"><div class="plupload_progress_container"><div class="ui-progressbar-value"></div></div></div><div class="plupload_cell plupload_upload_status"></div><div class="plupload_clearer">&nbsp;</div></div></td><td class="plupload_file_status"><span class="plupload_total_status">0%</span></td><td class="plupload_file_size"><span class="plupload_total_file_size">0 kb</span></td><td class="plupload_file_action"></td></tr></table></div><input class="plupload_count" value="0" type="hidden"></div>'),this.container=c(".plupload_container",this.element).attr("id",e+"_container"),this.content=c(".plupload_content",this.element),c.fn.resizable&&this.container.resizable({handles:"s",minHeight:300}),this.filelist=c(".plupload_filelist_content",this.container).attr({id:e+"_filelist",unselectable:"on"}),this.browse_button=c(".plupload_add",this.container).attr("id",e+"_browse"),this.start_button=c(".plupload_start",this.container).attr("id",e+"_start"),this.stop_button=c(".plupload_stop",this.container).attr("id",e+"_stop"),this.thumbs_switcher=c("#"+e+"_view_thumbs"),this.list_switcher=c("#"+e+"_view_list"),c.ui.button&&(this.browse_button.button({icons:{primary:"ui-icon-circle-plus"},disabled:!0}),this.start_button.button({icons:{primary:"ui-icon-circle-arrow-e"},disabled:!0}),this.stop_button.button({icons:{primary:"ui-icon-circle-close"}}),this.list_switcher.button({text:!1,icons:{secondary:"ui-icon-grip-dotted-horizontal"}}),this.thumbs_switcher.button({text:!1,icons:{secondary:"ui-icon-image"}})),this.progressbar=c(".plupload_progress_container",this.container),c.ui.progressbar&&this.progressbar.progressbar(),this.counter=c(".plupload_count",this.element).attr({id:e+"_count",name:e+"_count"}),this._initUploader()},_initUploader:function(){var s=this,t=this.id,e={container:t+"_buttons",browse_button:t+"_browse"};c(".plupload_buttons",this.element).attr("id",t+"_buttons"),s.options.dragdrop&&(this.filelist.parent().attr("id",this.id+"_dropbox"),e.drop_element=this.id+"_dropbox"),this.filelist.on("click",function(t){var e,i=c(t.target);i.hasClass("plupload_action_icon")&&(e=i.closest(".plupload_file")).hasClass("plupload_delete")&&(s.removeFile(e.attr("id")),t.preventDefault())}),e=this.uploader=i[t]=new d.Uploader(c.extend(this.options,e)),this.options=e.getOption(),s.options.views.thumbs&&(e.settings.required_features.display_media=!0),s.options.max_file_count&&d.extend(e.getOption("filters"),{max_file_count:s.options.max_file_count}),d.addFileFilter("max_file_count",function(t,e,i){t<=this.files.length-(this.total.uploaded+this.total.failed)?(s.browse_button.button("disable"),this.disableBrowse(),this.trigger("Error",{code:s.FILE_COUNT_ERROR,message:o("File count error."),file:e}),i(!1)):i(!0)}),e.bind("Error",function(t,e){var i="",l="<strong>"+e.message+"</strong>";switch(e.code){case d.FILE_EXTENSION_ERROR:i=d.sprintf(o("File: %s"),e.file.name);break;case d.FILE_SIZE_ERROR:i=d.sprintf(o("File: %s, size: %d, max file size: %d"),e.file.name,d.formatSize(e.file.size),d.formatSize(d.parseSize(t.getOption("filters").max_file_size)));break;case d.FILE_DUPLICATE_ERROR:i=d.sprintf(o("%s already present in the queue."),e.file.name);break;case s.FILE_COUNT_ERROR:i=d.sprintf(o("Upload element accepts only %d file(s) at a time. Extra files were stripped."),t.getOption("filters").max_file_count||0);break;case d.IMAGE_FORMAT_ERROR:i=o("Image format either wrong or not supported.");break;case d.IMAGE_MEMORY_ERROR:i=o("Runtime ran out of available memory.");break;case d.HTTP_ERROR:i=o("Upload URL might be wrong or doesn't exist.")}l+=" <br /><i>"+d.xmlEncode(i)+"</i>",s._trigger("error",null,{up:t,error:e}),e.code===d.INIT_ERROR?setTimeout(function(){s.destroy()},1):s.notify("error",l)}),e.bind("PostInit",function(t){s.options.buttons.browse?s.browse_button.button("enable"):(s.browse_button.button("disable").hide(),t.disableBrowse(!0)),s.options.buttons.start||s.start_button.button("disable").hide(),s.options.buttons.stop||s.stop_button.button("disable").hide(),!s.options.unique_names&&s.options.rename&&s._enableRenaming(),s.options.dragdrop&&t.features.dragdrop&&s.filelist.parent().addClass("plupload_dropbox"),s._enableViewSwitcher(),s.start_button.click(function(t){c(this).button("option","disabled")||s.start(),t.preventDefault()}),s.stop_button.click(function(t){s.stop(),t.preventDefault()}),s._trigger("ready",null,{up:t})}),e.init(),e.bind("FileFiltered",function(t,e){s._addFiles(e)}),e.bind("FilesAdded",function(t,e){s._trigger("selected",null,{up:t,files:e}),s.options.sortable&&c.ui.sortable&&s._enableSortingList(),s._trigger("updatelist",null,{filelist:s.filelist}),s.options.autostart&&setTimeout(function(){s.start()},10)}),e.bind("FilesRemoved",function(t,e){c.ui.sortable&&s.options.sortable&&c("tbody",s.filelist).sortable("destroy"),c.each(e,function(t,e){c("#"+e.id).toggle("highlight",function(){c(this).remove()})}),t.files.length&&s.options.sortable&&c.ui.sortable&&s._enableSortingList(),s._trigger("updatelist",null,{filelist:s.filelist}),s._trigger("removed",null,{up:t,files:e})}),e.bind("QueueChanged",function(){s._handleState()}),e.bind("StateChanged",function(t){s._handleState(),d.STARTED===t.state?s._trigger("started",null,{up:t}):d.STOPPED===t.state&&s._trigger("stopped",null,{up:t})}),e.bind("UploadFile",function(t,e){s._handleFileStatus(e)}),e.bind("FileUploaded",function(t,e,i){s._handleFileStatus(e),s._trigger("uploaded",null,{up:t,file:e,result:i})}),e.bind("UploadProgress",function(t,e){s._handleFileStatus(e),s._updateTotalProgress(),s._trigger("progress",null,{up:t,file:e})}),e.bind("UploadComplete",function(t,e){s._addFormFields(),s._trigger("complete",null,{up:t,files:e})})},_setOption:function(t,e){var i=this;"buttons"==t&&"object"==typeof e&&((e=c.extend(i.options.buttons,e)).browse?(i.browse_button.button("enable").show(),i.uploader.disableBrowse(!1)):(i.browse_button.button("disable").hide(),i.uploader.disableBrowse(!0)),e.start?i.start_button.button("enable").show():i.start_button.button("disable").hide(),e.stop?i.start_button.button("enable").show():i.stop_button.button("disable").hide()),i.uploader.setOption(t,e)},start:function(){this.uploader.start()},stop:function(){this.uploader.stop()},enable:function(){this.browse_button.button("enable"),this.uploader.disableBrowse(!1)},disable:function(){this.browse_button.button("disable"),this.uploader.disableBrowse(!0)},getFile:function(t){t="number"==typeof t?this.uploader.files[t]:this.uploader.getFile(t);return t},getFiles:function(){return this.uploader.files},removeFile:function(t){"string"===d.typeOf(t)&&(t=this.getFile(t)),this.uploader.removeFile(t)},clearQueue:function(){this.uploader.splice()},getUploader:function(){return this.uploader},refresh:function(){this.uploader.refresh()},notify:function(t,e){var i=c('<div class="plupload_message"><span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+o("Close")+'"></span><p><span class="ui-icon"></span>'+e+"</p></div>");i.addClass("ui-state-"+("error"===t?"error":"highlight")).find("p .ui-icon").addClass("ui-icon-"+("error"===t?"alert":"info")).end().find(".plupload_message_close").click(function(){i.remove()}).end(),c(".plupload_content",this.container).prepend(i)},destroy:function(){this.uploader.destroy(),c(".plupload_button",this.element).unbind(),c.ui.button&&c(".plupload_add, .plupload_start, .plupload_stop",this.container).button("destroy"),c.ui.progressbar&&this.progressbar.progressbar("destroy"),c.ui.sortable&&this.options.sortable&&c("tbody",this.filelist).sortable("destroy"),this.element.empty().html(this.contents_bak),this.contents_bak="",c.Widget.prototype.destroy.apply(this)},_handleState:function(){var t=this.uploader,e=t.files.length-(t.total.uploaded+t.total.failed),i=t.getOption("filters").max_file_count||0;d.STARTED===t.state?(c([]).add(this.stop_button).add(".plupload_started").removeClass("plupload_hidden"),this.start_button.button("disable"),this.options.multiple_queues||(this.browse_button.button("disable"),t.disableBrowse()),c(".plupload_upload_status",this.element).html(d.sprintf(o("Uploaded %d/%d files"),t.total.uploaded,t.files.length)),c(".plupload_header_content",this.element).addClass("plupload_header_content_bw")):d.STOPPED===t.state&&(c([]).add(this.stop_button).add(".plupload_started").addClass("plupload_hidden"),e?this.start_button.button("enable"):this.start_button.button("disable"),this.options.multiple_queues&&c(".plupload_header_content",this.element).removeClass("plupload_header_content_bw"),this.options.multiple_queues&&i&&e<i&&(this.browse_button.button("enable"),t.disableBrowse(!1)),this._updateTotalProgress()),0===t.total.queued?c(".ui-button-text",this.browse_button).html(o("Add Files")):c(".ui-button-text",this.browse_button).html(d.sprintf(o("%d files queued"),t.total.queued)),this.container.toggleClass("plupload_files_queued",t.files.length),t.refresh()},_handleFileStatus:function(t){var e,i,l=c("#"+t.id);if(l.length){switch(t.status){case d.DONE:e="plupload_done",i="plupload_action_icon ui-icon ui-icon-circle-check";break;case d.FAILED:e="ui-state-error plupload_failed",i="plupload_action_icon ui-icon ui-icon-alert";break;case d.QUEUED:e="plupload_delete",i="plupload_action_icon ui-icon ui-icon-circle-minus";break;case d.UPLOADING:e="ui-state-highlight plupload_uploading",i="plupload_action_icon ui-icon ui-icon-circle-arrow-w";var s=c(".plupload_scroll",this.container),o=s.scrollTop(),a=s.height(),n=l.position().top+l.height();a<n&&s.scrollTop(o+n-a),l.find(".plupload_file_percent").html(t.percent+"%").end().find(".plupload_file_progress").css("width",t.percent+"%").end().find(".plupload_file_size").html(d.formatSize(t.size))}e+=" ui-state-default plupload_file",l.attr("class",e).find(".plupload_action_icon").attr("class",i)}},_updateTotalProgress:function(){var t=this.uploader;this.filelist[0].scrollTop=this.filelist[0].scrollHeight,this.element.find(".plupload_total_status").html(t.total.percent+"%").end().find(".plupload_total_file_size").html(d.formatSize(t.total.size)).end().find(".plupload_progress .ui-progressbar-value").css("width",t.total.percent+"%").end().find(".plupload_upload_status").html(d.sprintf(o("Uploaded %d/%d files"),t.total.uploaded,t.files.length))},_displayThumbs:function(){var i,l,s,o=this,a=0,e=[],n=!1;function d(t,e,i){var l;t.on(e,function(){clearTimeout(l),l=setTimeout(function(){clearTimeout(l),i()},300)})}function u(){var t=Math.floor(o.content.scrollTop()/l)*s;e=c(".plupload_file .plupload_file_thumb",o.filelist).slice(t,t+a).filter(".plupload_thumb_toload").get()}function p(){function t(){"thumbs"===o.view_mode&&(function(){i&&l||(e=c(".plupload_file:eq(0)",o.filelist),i=e.outerWidth(!0),l=e.outerHeight(!0));var t=o.content.width(),e=o.content.height();s=Math.floor(t/i),a=s*(Math.ceil(e/l)+1)}(),u(),function t(){if("thumbs"!==o.view_mode||n)return;u();if(!e.length)return;n=!0;r(o.getFile(c(e.shift()).closest(".plupload_file").attr("id")),function(){n=!1,t()})}())}c.fn.resizable&&d(o.container,"resize",t),d(o.window,"resize",t),d(o.content,"scroll",t),o.element.on("viewchanged selected",t),t()}function r(e,i){var t=new _.image.Image,l=_.core.utils.Url.resolveUrl;t.onload=function(){var t=c("#"+e.id+" .plupload_file_thumb",o.filelist);this.embed(t[0],{width:o.options.thumb_width,height:o.options.thumb_height,crop:!0,fit:!0,preserveHeaders:!1,swf_url:l(o.options.flash_swf_url),xap_url:l(o.options.silverlight_xap_url)})},t.bind("embedded error",function(t){c("#"+e.id,o.filelist).find(".plupload_file_thumb").removeClass("plupload_thumb_loading").addClass("plupload_thumb_"+t.type),this.destroy(),setTimeout(i,1)}),c("#"+e.id,o.filelist).find(".plupload_file_thumb").removeClass("plupload_thumb_toload").addClass("plupload_thumb_loading"),t.load(e.getSource())}this.options.views.thumbs&&this.element.on("selected",function t(){o.element.off("selected",t),p()})},_addFiles:function(t){var s=this,e="",o='<li class="plupload_file ui-state-default plupload_delete" id="{id}" style="width:{thumb_width}px;"><div class="plupload_file_thumb plupload_thumb_toload" style="width: {thumb_width}px; height: {thumb_height}px;"><div class="plupload_file_dummy ui-widget-content" style="line-height: {thumb_height}px;"><span class="ui-state-disabled">{ext} </span></div></div><div class="plupload_file_status"><div class="plupload_file_progress ui-widget-header" style="width: 0%"> </div><span class="plupload_file_percent">{percent} </span></div><div class="plupload_file_name" title="{name}"><span class="plupload_file_name_wrapper">{name} </span></div><div class="plupload_file_action"><div class="plupload_action_icon ui-icon ui-icon-circle-minus"> </div></div><div class="plupload_file_size">{size} </div><div class="plupload_file_fields"> </div></li>';"array"!==d.typeOf(t)&&(t=[t]),c.each(t,function(t,i){var l=_.core.utils.Mime.getFileExtension(i.name)||"none";e+=o.replace(/\{(\w+)\}/g,function(t,e){switch(e){case"thumb_width":case"thumb_height":return s.options[e];case"size":return d.formatSize(i.size);case"ext":return l;default:return d.xmlEncode(i[e]||"")}})}),s.filelist.append(e)},_addFormFields:function(){var l=this;c(".plupload_file_fields",this.filelist).html(""),d.each(this.uploader.files,function(t,e){var i="",e=l.id+"_"+e;t.target_name&&(i+='<input type="hidden" name="'+e+'_tmpname" value="'+d.xmlEncode(t.target_name)+'" />'),i+='<input type="hidden" name="'+e+'_name" value="'+d.xmlEncode(t.name)+'" />',i+='<input type="hidden" name="'+e+'_status" value="'+(t.status===d.DONE?"done":"failed")+'" />',c("#"+t.id).find(".plupload_file_fields").html(i)}),this.counter.val(this.uploader.files.length)},_viewChanged:function(t){this.options.views.remember&&c.cookie&&c.cookie("plupload_ui_view",t,{expires:7,path:"/"}),"IE"===d.ua.browser&&d.ua.version<7&&this.content.attr("style",'height:expression(document.getElementById("'+this.id+'_container").clientHeight - '+("list"===t?132:102)+")"),this.container.removeClass("plupload_view_list plupload_view_thumbs").addClass("plupload_view_"+t),this.view_mode=t,this._trigger("viewchanged",null,{view:t})},_enableViewSwitcher:function(){var e,t,i=this,l=c(".plupload_view_switch",this.container);d.each(["list","thumbs"],function(t){i.options.views[t]||l.find('[for="'+i.id+"_view_"+t+'"], #'+i.id+"_view_"+t).remove()}),1===(t=l.find(".plupload_button")).length?(l.hide(),e=t.eq(0).data("view"),this._viewChanged(e)):c.ui.button&&1<t.length?(this.options.views.remember&&c.cookie&&(e=c.cookie("plupload_ui_view")),~d.inArray(e,["list","thumbs"])||(e=this.options.views.active),l.show().buttonset().find(".ui-button").click(function(t){e=c(this).data("view"),i._viewChanged(e),t.preventDefault()}),(t=l.find('[for="'+i.id+"_view_"+e+'"]')).length&&t.trigger("click")):(l.show(),this._viewChanged(this.options.views.active)),this.options.views.thumbs&&this._displayThumbs()},_enableRenaming:function(){var o=this;this.filelist.dblclick(function(t){var i,e,l="",s=c(t.target);s.hasClass("plupload_file_name_wrapper")&&(e=s.closest(".plupload_file")).hasClass("plupload_delete")&&(t=(i=o.uploader.getFile(e[0].id)).name,(e=/^(.+)(\.[^.]+)$/.exec(t))&&(t=e[1],l=e[2]),c('<input class="plupload_file_rename" type="text" />').width(s.width()).insertAfter(s.hide()).val(t).blur(function(){s.show().parent().scrollLeft(0).end().next().remove()}).keydown(function(t){var e=c(this);-1!==c.inArray(t.keyCode,[13,27])&&(t.preventDefault(),13===t.keyCode&&(i.name=e.val()+l,s.text(i.name)),e.blur())})[0].focus())})},_enableSortingList:function(){var l=this;c(".plupload_file",this.filelist).length<2||(c("tbody",this.filelist).sortable("destroy"),this.filelist.sortable({items:".plupload_delete",cancel:"object, .plupload_clearer",stop:function(){var i=[];c.each(c(this).sortable("toArray"),function(t,e){i[i.length]=l.uploader.getFile(e)}),i.unshift(i.length),i.unshift(0),Array.prototype.splice.apply(l.uploader.files,i)}}))}})}((window,document,plupload),moxie,jQuery);

/*!
 * jQuery UI Progressbar 1.10.4
 * http://jqueryui.com
 *
 * Copyright 2014 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/progressbar/
 *
 * Depends:
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 */
!function(t,i){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){if(e===i)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return e===i&&(e=this.options.value),this.indeterminate=!1===e,"number"!=typeof e&&(e=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var i=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(i),this._refreshValue()},_setOption:function(e,i){"max"===e&&(i=Math.max(this.min,i)),this._super(e,i)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})}(jQuery);
/*!
 * jQuery UI Button 1.10.4
 * http://jqueryui.com
 *
 * Copyright 2014 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/button/
 *
 * Depends:
 *  jquery.ui.core.js
 *  jquery.ui.widget.js
 */
!function(o){function n(){var t=o(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)}function a(t){var e=t.name,i=t.form,s=o([]);return e&&(e=e.replace(/'/g,"\\'"),s=i?o(i).find("[name='"+e+"']"):o("[name='"+e+"']",t.ownerDocument).filter(function(){return!this.form})),s}var u,r="ui-button ui-widget ui-state-default ui-corner-all",l="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only";o.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,n),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var e=this,i=this.options,t="checkbox"===this.type||"radio"===this.type,s=t?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(r).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===u&&o(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||o(this).removeClass(s)}).bind("click"+this.eventNamespace,function(t){i.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),t&&this.element.bind("change"+this.eventNamespace,function(){e.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;o(this).addClass("ui-state-active"),e.buttonElement.attr("aria-pressed","true");var t=e.element[0];a(t).not(t).map(function(){return o(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return!i.disabled&&(o(this).addClass("ui-state-active"),u=this,void e.document.one("mouseup",function(){u=null}))}).bind("mouseup"+this.eventNamespace,function(){return!i.disabled&&void o(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){return!i.disabled&&void(t.keyCode!==o.ui.keyCode.SPACE&&t.keyCode!==o.ui.keyCode.ENTER||o(this).addClass("ui-state-active"))}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){o(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===o.ui.keyCode.SPACE&&o(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var t,e;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=(t.length?t:this.element).siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),(e=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",e)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(r+" ui-state-active "+l).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){if(this._super(t,e),"disabled"===t)return this.element.prop("disabled",!!e),void(e&&this.buttonElement.removeClass("ui-state-focus"));this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){o(this).is(":checked")?o(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):o(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){var t,e,i,s,n;"input"!==this.type?(t=this.buttonElement.removeClass(l),e=o("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=(i=this.options.icons).primary&&i.secondary,n=[],i.primary||i.secondary?(this.options.text&&n.push("ui-button-text-icon"+(s?"s":i.primary?"-primary":"-secondary")),i.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+i.primary+"'></span>"),i.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+i.secondary+"'></span>"),this.options.text||(n.push(s?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",o.trim(e)))):n.push("ui-button-text-only"),t.addClass(n.join(" "))):this.options.label&&this.element.val(this.options.label)}}),o.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return o(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return o(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery);

/*!
 * jQuery UI Sortable 1.10.4
 * http://jqueryui.com
 *
 * Copyright 2014 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/sortable/
 *
 * Depends:
 *  jquery.ui.core.js
 *  jquery.ui.mouse.js
 *  jquery.ui.widget.js
 */
!function(u){function d(t,e,i){return e<t&&t<e+i}function m(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}u.widget("ui.sortable",u.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||m(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,e){"disabled"===t?(this.options[t]=e,this.widget().toggleClass("ui-sortable-disabled",!!e)):u.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,e){var i=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),u(t.target).parents().each(function(){if(u.data(this,o.widgetName+"-item")===o)return i=u(this),!1}),u.data(t.target,o.widgetName+"-item")===o&&(i=u(t.target)),!!i&&(!(this.options.handle&&!e&&(u(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,o,r=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},u.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=u("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(o)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,o,r=this.options,n=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<r.scrollSensitivity?this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop+r.scrollSpeed:t.pageY-this.overflowOffset.top<r.scrollSensitivity&&(this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop-r.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<r.scrollSensitivity?this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft+r.scrollSpeed:t.pageX-this.overflowOffset.left<r.scrollSensitivity&&(this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft-r.scrollSpeed)):(t.pageY-u(document).scrollTop()<r.scrollSensitivity?n=u(document).scrollTop(u(document).scrollTop()-r.scrollSpeed):u(window).height()-(t.pageY-u(document).scrollTop())<r.scrollSensitivity&&(n=u(document).scrollTop(u(document).scrollTop()+r.scrollSpeed)),t.pageX-u(document).scrollLeft()<r.scrollSensitivity?n=u(document).scrollLeft(u(document).scrollLeft()-r.scrollSpeed):u(window).width()-(t.pageX-u(document).scrollLeft())<r.scrollSensitivity&&(n=u(document).scrollLeft(u(document).scrollLeft()+r.scrollSpeed))),!1!==n&&u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;0<=e;e--)if(i=this.items[e],s=i.item[0],o=this._intersectsWithPointer(i),o&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||u.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&u.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),u.ui.ddmanager&&u.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,o,r;if(t)return u.ui.ddmanager&&!this.options.dropBehaviour&&u.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),r={},(o=this.options.axis)&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,u(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),u.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?u(this.domPosition.prev).after(this.currentItem):u(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},u(t).each(function(){var t=(u(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(u(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,r=t.left,n=r+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||h<s+l&&s+l<a,c="y"===this.options.axis||r<e+c&&e+c<n,c=l&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?c:r<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<n&&h<s+this.helperProportions.height/2&&o-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var e="x"===this.options.axis||d(this.positionAbs.top+this.offset.click.top,t.top,t.height),i="y"===this.options.axis||d(this.positionAbs.left+this.offset.click.left,t.left,t.width),t=e&&i,e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return!!t&&(this.floating?i&&"right"===i||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=d(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=d(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),t=this._getDragHorizontalDirection();return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,o,r=[],n=[],h=this._connectWith();if(h&&t)for(e=h.length-1;0<=e;e--)for(i=(s=u(h[e])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&n.push([u.isFunction(o.options.items)?o.options.items.call(o.element):u(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function a(){r.push(this)}for(n.push([u.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):u(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=n.length-1;0<=e;e--)n[e][0].each(a);return u(r)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=u.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,o,r,n,h,a,l=this.items,c=[[u.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):u(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(e=p.length-1;0<=e;e--)for(i=(s=u(p[e])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push([u.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):u(o.options.items,o.element),o]),this.containers.push(o));for(e=c.length-1;0<=e;e--)for(r=c[e][1],i=0,a=(n=c[e][0]).length;i<a;i++)(h=u(n[i])).data(this.widgetName+"-item",r),l.push({item:h,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var e,i,s,o;for(this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),e=this.items.length-1;0<=e;e--)(i=this.items[e]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?u(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),o=s.offset(),i.left=o.left,i.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)o=this.containers[e].element.offset(),this.containers[e].containerCache.left=o.left,this.containers[e].containerCache.top=o.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,o.placeholder={element:function(){var t=i.currentItem[0].nodeName.toLowerCase(),e=u("<"+t+">",i.document[0]).addClass(s||i.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===t?i.currentItem.children().each(function(){u("<td>&#160;</td>",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)}):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(l=c.floating||m(this.currentItem))?"left":"top",r=l?"width":"height",n=this.positionAbs[o]+this.offset.click[o],e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(l&&!d(this.positionAbs.top+this.offset.click.top,this.items[e].top,this.items[e].height)||(h=this.items[e].item.offset()[o],a=!1,Math.abs(h-n)>Math.abs(h+this.items[e][r]-n)&&(a=!0,h+=this.items[e][r]),Math.abs(h-n)<i&&(i=Math.abs(h-n),s=this.items[e],this.direction=a?"up":"down")));(s||this.options.dropOnEmpty)&&this.currentContainer!==this.containers[p]&&(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1)}},_createHelper:function(t){var e=this.options,t=u.isFunction(e.helper)?u(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||u("parent"!==e.appendTo?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),u.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&u.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&u.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,u("document"===i.containment?document:window).width()-this.helperProportions.width-this.margins.left,(u("document"===i.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=u(i.containment)[0],e=u(i.containment).offset(),i="hidden"!==u(t).css("overflow"),this.containment=[e.left+(parseInt(u(t).css("borderLeftWidth"),10)||0)+(parseInt(u(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(u(t).css("borderTopWidth"),10)||0)+(parseInt(u(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(u(t).css("borderLeftWidth"),10)||0)-(parseInt(u(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(u(t).css("borderTopWidth"),10)||0)-(parseInt(u(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return!(this.fromOutside=!1)},_trigger:function(){!1===u.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||u([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})}(jQuery);

/*!
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(s){var n=/\+/g;function f(e){return x.raw?e:encodeURIComponent(e)}function m(e,o){e=x.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(n," ")),x.json?JSON.parse(e):e}catch(e){}}(e);return s.isFunction(o)?o(e):e}var x=s.cookie=function(e,o,n){var i,r;if(void 0!==o&&!s.isFunction(o))return"number"==typeof(n=s.extend({},x.defaults,n)).expires&&(r=n.expires,(i=n.expires=new Date).setTime(+i+864e5*r)),document.cookie=[f(e),"=",(r=o,f(x.json?JSON.stringify(r):String(r))),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("");for(var t=e?void 0:{},c=document.cookie?document.cookie.split("; "):[],u=0,a=c.length;u<a;u++){var d=c[u].split("="),p=(p=d.shift(),x.raw?p:decodeURIComponent(p)),d=d.join("=");if(e&&e===p){t=m(d,o);break}e||void 0===(d=m(d))||(t[p]=d)}return t};x.defaults={},s.removeCookie=function(e,o){return void 0!==s.cookie(e)&&(s.cookie(e,"",s.extend({},o,{expires:-1})),!s.cookie(e))}});
